package main.java.eu.jpereira.trainings.designpatterns.behavioral.state.appliance.state;

/**
 * @author jpereira
 * 
 * TODO: Find the TODOs in this file and complete them
 *
 */
public class OffState implements ApplianceStateBehavior {

        /* (non-Javadoc)
         * @see eu.jpereira.trainings.designpatterns.behavioral.state.appliance.state.ApplianceStateBehavior#getState()
         */
        @Override
        public ApplianceState getState() {
                
                return ApplianceState.OFF;
        }

        /* (non-Javadoc)
         * @see eu.jpereira.trainings.designpatterns.behavioral.state.appliance.state.ApplianceStateBehavior#start()
         */
        @Override
        public ApplianceStateBehavior start() {
                
                //Do nothing, can't go to started when off. Must return the same state
                //TODO: Return a reference to this object
                return this;
                
                
        }

        /* (non-Javadoc)
         * @see eu.jpereira.trainings.designpatterns.behavioral.state.appliance.state.ApplianceStateBehavior#stop()
         */
        @Override
        public ApplianceStateBehavior stop() {
                //Do nothing. Can't go from OFF to STOPPED
                //TODO: Return a reference to this object
                return this;
        }

        /* (non-Javadoc)
         * @see eu.jpereira.trainings.designpatterns.behavioral.state.appliance.state.ApplianceStateBehavior#turnOn()
         */
        @Override
        public ApplianceStateBehavior turnOn() {
                //Can go from OFF state (this) to ON state
                /*TODO: Return the behavior for ON .Example: */
                return ApplianceState.ON.getStateBehavior();
                
                //return null;
        }

        /* (non-Javadoc)
         * @see eu.jpereira.trainings.designpatterns.behavioral.state.appliance.state.ApplianceStateBehavior#turnOff()
         */
        @Override
        public ApplianceStateBehavior turnOff() {
                //Do nothing. It's already off
                return this;
        }

}